﻿using System;
using System.Collections.Generic;
using System.Globalization;
using NTQOnlineExam.Services.Infrastructure.Utility;
using NTQOnlineExam.Services.Resources;

namespace NTQOnlineExam.Services.Models
{
    public class OrderDTO
    {
        public Guid OrderId { get; set; }
        public int UserId { get; set; }
        public string Email { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string FullName { get { return FirstName + " " + LastName; }}
        public string BillingAddress { get; set; }
        public string BillingZipCode { get; set; }
        public string BillingPOBox { get; set; }
        public string BillingCity { get; set; }
        public string BillingCountry { get; set; }
        public DateTime CreationDate { get; set; }

        public string CreationDateDisplay
        {
            get { return CreationDate.ToString(ServiceResource.LongDateTimeFormat); }
        }
        public string TransactionNo { get; set; }
        public decimal SubTotal { get; set; }

        public string SubTotalDisplay
        {
            get { return SubTotal.ToString("#.##", new CultureInfo("en-US")); }
        }
        public decimal? PaymentFee { get; set; }
        public decimal? PaymentFeeTax { get; set; }
        public int Status { get; set; }
        public int OrderUniqueId { get; set; }
        public int OrderType { get; set; }
        public string StatusDescription
        {
            get { return ((OrderStatus)Status).ToDescriptionString(); }
        }

        public string OrderTypeDescription
        {
            get { return ((OrderType)OrderType).ToDescriptionString(); }
        }
        public ICollection<OrderDetailDTO> OrderDetails { get; set; } 
    }
}
